(function(){
	 var page = 1;
	  function getListJson(fn){
		   $.ajax({
			   url : '../../portal/column/findInformationList.json?queryClassifyId=MANAGEMENT_ROOT_ID&pageSize=5&currentPage=' + page,
			   type : 'get',
			   dataType : 'json',
			   success : function(result){
				   if(result.success){
					   //循环遍历,抽出时间
					   for(var i = 0; i < result.data.resultList.length; i++){
						    var time = new Date(result.data.resultList[i].publishTime);
						    var year = time.getFullYear();
						    var Month = time.getMonth() + 1 ;
				            var Day = time.getDate(); 
				            if( result.data.resultList[i].publishTime){
				            result.data.resultList[i].updataTime = Month + '-' + Day;
				          }
				            if(result.data.resultList[i].keyWord){
				            result.data.resultList[i].keyWord = result.data.resultList[i].keyWord.split('|');	
				            }
					   }
					   var ListDOM = _.template($('#knowledgeTpl').html())(result.data);
					  $('#knowledgeList').html(ListDOM);
					  var maxPage = result.data.maxPage || 1;
					  if(fn)(fn(maxPage));
				   }
				   
			   }
		   })
	  }
	  getListJson(pageComponents);
	//将翻页组件提出来
	  function pageComponents(maxPage){
	  	  var maxPage = maxPage;
	  	  //将翻页组件插入进来
	  	  var components = new PageNum(maxPage);
	  	  //为翻页添加事件；
	  	  components.events(function(num){
	  		      page = num;
	  		      getListJson();
	  	  })
	  }
})()